#include "WindowManager.hpp"
void WindowManager::addWindow(BaseWindow* const window) {
    if (window)
        show_list.push_back(window);
}

void WindowManager::removeWindow(BaseWindow* const window) {
    show_list.remove(window);
    remove_list.push_back(window);
}

bool WindowManager::loadWindow()
{
    while (!remove_list.empty()) {
        delete remove_list.front();
        remove_list.pop_front();
    }
    if (show_list.empty()) {
        return false;
    }
    (*--show_list.end())->start();
    return true;
}
